﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MCToOrder.aspx.cs" Inherits="OLPC_MCToOrder" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1.Export, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxClasses" tagprefix="dx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>收款与订单匹配</title>
    <link href="../Styles/main.css" rel="Stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="../Jscript/common.js"></script>
    <script language="javascript" type="text/javascript" src="../Jscript/olpc.js"></script>
    <script type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div id="headlocation" class="headlocation">
            <asp:Label ID="lblLocation" runat="server" Text="当前位置"></asp:Label>
            <img alt="当前位置" src="../Image/weizhi.gif" />>>
            <asp:Label ID="Label1" runat="server" Text="收款匹配"></asp:Label>
        </div>   
      <asp:UpdatePanel ID="upd" runat="server">
          <ContentTemplate>      
            <div id="covertDiv" class="transp" style="display:none;"></div>
                <asp:UpdateProgress ID="UpdateProgress3" runat="server">    
                    <ProgressTemplate>
                        <div class="transp" style="text-align:center; padding: auto auto;">
                        <span style="font-size:25px; color:Blue;">Data Loading..... </span></div>
                    </ProgressTemplate>
                </asp:UpdateProgress> 
            <dx:ASPxPageControl ID="tc" runat="server" ActiveTabIndex="0" 
                CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua"
                SpriteCssFilePath="~/App_Themes/Aqua/{0}/sprite.css" TabSpacing="3px" 
                Width="100%">
                <TabPages>
                    <dx:TabPage Name="tabmcinformation" Text="已有可匹配收款">                       
                        <ContentCollection>
                            <dx:ContentControl ID="ccdelivery" runat="server">                                
                                <div style="padding:5px 10px 5px 10px;">
                                    <dx:ASPxGridView ID="gv" Width="100%" runat="server" 
                                        AutoGenerateColumns="False" KeyFieldName="AccountStatementItemCode" ClientInstanceName="gv" 
                                        OnAfterPerformCallback="gv_AfterPerformCallback" 
                                        OnRowCommand="gv_RowCommand">
                                        <Columns>
                                            <dx:GridViewDataColumn Caption="匹 配" Width="60px" FixedStyle="Left">
                                                <DataItemTemplate>
                                                    <asp:Button runat="server" CommandArgument='<%# Eval("AccountStatementItemCode") %>'
                                                     CommandName="assigning" ToolTip="匹配" Text="匹 配"
                                                     CssClass="cmdStylepipei" />
                                                </DataItemTemplate>
                                                <CellStyle HorizontalAlign="Center">
                                                </CellStyle>
                                            </dx:GridViewDataColumn>
                                            <dx:GridViewDataTextColumn Caption="银行参考号" FieldName="BankReference" 
                                                Width="140px">
                                                <Settings AutoFilterCondition="Contains" FilterMode="DisplayText" />
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="客户参考号" FieldName="CustomerReference" Visible="false">
                                                <Settings AutoFilterCondition="Contains" FilterMode="DisplayText" />
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataDateColumn Caption="起息日" FieldName="ValueDate" Width="140px" 
                                                UnboundType="DateTime">
                                                <Settings AutoFilterCondition="Greater" />
                                                <PropertiesDateEdit DisplayFormatString="{0:yyyy-MM-dd}"></PropertiesDateEdit>
                                            </dx:GridViewDataDateColumn>
                                            <dx:GridViewDataDateColumn Caption="入账日期" FieldName="EntryDate" Width="110px" 
                                                FixedStyle="Left" UnboundType="DateTime">
                                                <Settings AutoFilterCondition="Greater" />
                                                <PropertiesDateEdit DisplayFormatString="{0:yyyy-MM-dd}"></PropertiesDateEdit>
                                            </dx:GridViewDataDateColumn>
                                            <dx:GridViewDataTextColumn Caption="交易金额" FieldName="TransactionAmount" 
                                                Width="110px" FixedStyle="Left" UnboundType="Decimal">
                                                <Settings AutoFilterCondition="GreaterOrEqual" />
                                                <PropertiesTextEdit DisplayFormatString="{0:N2}" />
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="已分配金额" FieldName="AppliedAmount" 
                                                Width="110px" FixedStyle="Left" UnboundType="Decimal">
                                                <Settings AutoFilterCondition="GreaterOrEqual" />
                                                <PropertiesTextEdit DisplayFormatString="{0:N2}" />
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="剩余金额" FieldName="TransactionAmountLeft" 
                                                Width="110px" FixedStyle="Left" UnboundType="Decimal">
                                                <Settings AutoFilterCondition="GreaterOrEqual" />
                                                <PropertiesTextEdit DisplayFormatString="{0:N2}" />
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="产品类型" FieldName="ProductType" Width="160px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="交易说明" FieldName="TransactionDescription" Width="200px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="额外信息" FieldName="ExtraInformation" Width="200px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="汇款人/开票人名称" FieldName="OrderingPartyName" Width="200px" FixedStyle="Left">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="汇款人/开票人账户" FieldName="OrderingPartyAccount" Width="200px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="定购方银行名称" FieldName="OrderingPartyBankName" Width="200px">
                                            </dx:GridViewDataTextColumn>   
                                            <dx:GridViewDataTextColumn Caption="客户名称" FieldName="CustomerName" Width="200px">
                                            </dx:GridViewDataTextColumn>                                     
                                            <dx:GridViewDataTextColumn Caption="付款细节" FieldName="PaymentDetails" Width="220px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="公司" FieldName="CoName" Width="120px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="状态" FieldName="StateText" Width="70px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="状态值" FieldName="StateValue" Visible="false">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="备注" FieldName="Remarks" Visible="False">
                                            </dx:GridViewDataTextColumn>
                                        </Columns>
                                        <SettingsPager PageSize="10" Mode="ShowPager">
                                        </SettingsPager>
                                        <SettingsBehavior ColumnResizeMode="Control" SortMode="DisplayText"></SettingsBehavior>
                                        <Settings ShowFilterRow="True" ShowGroupPanel="True" ShowFilterRowMenu="true"
                                            ShowHorizontalScrollBar="True" VerticalScrollableHeight="22" 
                                            ShowFilterBar="Visible" ShowFooter="True">
                                        </Settings>
                                    </dx:ASPxGridView>
                                </div>
                                <div id="Div1" runat="server" style="margin:15px 0 15px 0; text-align:center;">                                    
                                    <dx:ASPxGridViewExporter ID="gridready" runat="server" GridViewID="gv">
                                    </dx:ASPxGridViewExporter>
                                    <asp:Button runat="server" ID="btnMathingExport" CssClass="cmdStyle" Text="导 出" 
                                    style="margin-left:20px;" OnClick="btnMathingExport_Click" />
                                </div>
                            </dx:ContentControl>
                        </ContentCollection>
                    </dx:TabPage>
                    <dx:TabPage Name="tabmcinformation" Text="已匹配收款">                       
                        <ContentCollection>
                            <dx:ContentControl ID="ContentControl1" runat="server">                                
                                <div style="padding:5px 10px 5px 10px;">
                                    <dx:ASPxGridView ID="gvAssigned" Width="100%" runat="server" 
                                        AutoGenerateColumns="False" ClientInstanceName="gvAssigned" 
                                        KeyFieldName="AccountStatementManualID" 
                                        OnAfterPerformCallback="gvAssigned_AfterPerformCallback" 
                                        OnRowCommand="gvAssigned_RowCommand" >
                                        <Columns>
                                            <dx:GridViewDataColumn Caption="View" Width="40px" FixedStyle="Left">
                                                <DataItemTemplate>
                                                    <asp:ImageButton ID="imgbtnDelete" runat="server" AlternateText="View"
                                                        CommandArgument='<%# Eval("AccountStatementItemCode") %>' CommandName="view"
                                                        ImageUrl="../Image/print.jpg" />
                                                </DataItemTemplate>
                                                <CellStyle HorizontalAlign="Center">
                                                </CellStyle>
                                            </dx:GridViewDataColumn>
                                            <dx:GridViewDataColumn Caption="编辑" Width="40px" FixedStyle="Left">
                                                <DataItemTemplate>
                                                    <asp:ImageButton ID="imgbtnDelete" runat="server" AlternateText="编辑"
                                                        CommandArgument='<%# Eval("AccountStatementItemCode") %>' CommandName="edit"
                                                        ImageUrl="../Image/edit.gif"
                                                        Visible='<%# IsVisibale(Convert.ToString(Eval("StateValue"))) %>' />
                                                </DataItemTemplate> 
                                                <CellStyle HorizontalAlign="Center">
                                                </CellStyle>
                                            </dx:GridViewDataColumn>
                                            <dx:GridViewDataColumn Caption="删除" Width="40px" FixedStyle="Left">
                                                <DataItemTemplate>
                                                    <asp:ImageButton ID="Button1" runat="server" 
                                                    CommandArgument='<%# Eval("AccountStatementItemCode") %>'
                                                     CommandName="delete" ToolTip="删除" Text="删除" ImageUrl="~/Image/del.gif" 
                                                     OnClientClick="return confirm('你确定要删除');"
                                                        Visible='<%# IsVisibale(Convert.ToString(Eval("StateValue"))) %>' />
                                                </DataItemTemplate>
                                                <CellStyle HorizontalAlign="Center">
                                                </CellStyle>
                                            </dx:GridViewDataColumn>
                                            <dx:GridViewDataCheckColumn Caption="CreditCheck" Width="80px" FixedStyle="Left">
                                                <DataItemTemplate>
                                                    <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true"
                                                    Checked='<%# CreditChecked(Convert.ToString(Eval("CreditCheck"))) %>'
                                                    ToolTip='<%# Eval("AccountStatementManualID") %>' 
                                                    Enabled='<%# IsEnabledCreditCheck() %>'                              
                                                        OnCheckedChanged="chk_CreditCheck" />
                                                </DataItemTemplate>
                                                <CellStyle HorizontalAlign="Center"></CellStyle>
                                                <PropertiesCheckEdit DisplayTextChecked="是" DisplayTextUnchecked="否">
                                                </PropertiesCheckEdit>
                                            </dx:GridViewDataCheckColumn>
                                            <dx:GridViewDataTextColumn Caption="银行参考号" FieldName="BankReference" 
                                                Width="140px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="交易金额" FieldName="TransactionAmount" 
                                                Width="110px" FixedStyle="Left" UnboundType="Decimal">
                                                <Settings AutoFilterCondition="GreaterOrEqual" />
                                                <PropertiesTextEdit DisplayFormatString="{0:N2}" />
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="合同号" FieldName="ContractNo" 
                                                Width="140px" FixedStyle="Left">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="Order NO." FieldName="SalesOrderNo" 
                                                Width="140px" FixedStyle="Left">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="匹配金额" FieldName="ApplyAmount"
                                             Width="110px" FixedStyle="Left" UnboundType="Decimal">
                                                <Settings AutoFilterCondition="GreaterOrEqual" />
                                                <PropertiesTextEdit DisplayFormatString="{0:N2}" />
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="收款类型" FieldName="CollectionType" Width="160px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="匹配人" FieldName="showname" Width="160px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataDateColumn Caption="匹配时间" FieldName="UPDATEDATE" Width="140px" 
                                                FixedStyle="Left" UnboundType="DateTime">
                                                <PropertiesDateEdit DisplayFormatString="{0:yyyy-MM-dd HH:mm}" 
                                                    EditFormat="DateTime">
                                                    <CalendarProperties ClearButtonText="清空" TodayButtonText="今天">
                                                    </CalendarProperties>
                                                </PropertiesDateEdit>
                                            </dx:GridViewDataDateColumn>
                                            <dx:GridViewDataTextColumn Caption="客户编号" FieldName="CustomerCode" Width="100px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="客户" FieldName="Customer" Width="160px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="销售员" FieldName="Salesman" Width="140px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="CE" FieldName="CEName" Width="140px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="订单金额" FieldName="SalesOrderAmountVAT" 
                                                Width="110px" UnboundType="Decimal">
                                                <Settings AutoFilterCondition="GreaterOrEqual" />
                                                <PropertiesTextEdit DisplayFormatString="{0:N2}" />
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="收款比例(%)" FieldName="APSOA" Width="80px" UnboundType="DateTime">
                                                <Settings AutoFilterCondition="GreaterOrEqual" />
                                            </dx:GridViewDataTextColumn>
                                            <%--<dx:GridViewDataTextColumn Caption="状态" FieldName="StateText" Width="160px">
                                            </dx:GridViewDataTextColumn>--%>
                                        </Columns>
                                        <SettingsPager PageSize="10" Mode="ShowPager">
                                        </SettingsPager>
                                        <SettingsBehavior ColumnResizeMode="Control" AllowSelectByRowClick="True" 
                                            SortMode="DisplayText"></SettingsBehavior>
                                        <Settings ShowFilterRow="True" ShowGroupPanel="True" ShowFilterRowMenu="true"
                                        ShowHorizontalScrollBar="True" VerticalScrollableHeight="22" 
                                            ShowFilterBar="Visible" ShowFooter="True">
                                        </Settings>
                                    </dx:ASPxGridView>
                                </div>
                                <div id="exportdiv" runat="server" style="margin:15px 0 15px 0; text-align:center;">                                    
                                    <dx:ASPxGridViewExporter ID="gridreadied" runat="server" GridViewID="gvAssigned">
                                    </dx:ASPxGridViewExporter>
                                    <asp:Button runat="server" ID="btnMathedExport" CssClass="cmdStyle" Text="导 出" 
                                    style="margin-left:20px;" OnClick="btnMathedExport_Click" />
                                </div>
                            </dx:ContentControl>
                        </ContentCollection>
                    </dx:TabPage>
                    <dx:TabPage Name="tabmcinformation" Text="收款匹配">                       
                        <ContentCollection>
                            <dx:ContentControl ID="ccorder" runat="server">
                                <div style="margin:15px 0px 20px 0px; height:490px; width:100%; overflow:auto; table-layout:fixed;">
                                          <asp:Label ID="lblAccountStatementItemCode" runat="server" Text="" Visible="false"></asp:Label>                                    
                                    <div style="width:560px; table-layout:fixed; float:left;">
                                        <ul>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="合同号："></asp:Label>
                                                <dx:ASPxComboBox ID="cbContractNo" CssClass="floatleft" runat="server" DropDownStyle="DropDown" 
                                                    Width="215px" AutoPostBack="True" 
                                                    OnTextChanged="cbContractNo_TextChanged">
                                                </dx:ASPxComboBox>
                                                <span class="red">*</span>
                                            </li>
                                        </ul>
                                        <ul>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="订单号："></asp:Label>
                                                <dx:ASPxComboBox ID="cbSalesOrder" runat="server" DropDownStyle="DropDown" 
                                                    CssClass="floatleft" Width="215px" OnTextChanged="cbSalesOrder_TextChanged" 
                                                    AutoPostBack="True">
                                                </dx:ASPxComboBox>
                                                <span class="red">*</span>
                                            </li>
                                        </ul>
                                        <ul>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="订单金额(VAT)："></asp:Label>
                                                <%--<asp:TextBox runat="server" ID="txtSalesOrderAmountVAT" Text="0" CssClass="mctxt2" 
                                                 ReadOnly="true"></asp:TextBox>--%>
                                                 <input type="text" runat="server" id="txtSalesOrderAmountVAT" class="mctxt2" readonly="readonly" value="0" />
                                            </li>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="合同已匹配金额："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtCAppliedAmount" Text="0" CssClass="mctxt2" 
                                                 ReadOnly="true"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="订单已匹配金额："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtOAppliedAmount" Text="0" CssClass="mctxt2" 
                                                 ReadOnly="true"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="销售员："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtSalesman" Text="" ReadOnly="true" CssClass="mctxt2"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="Collection % against sales order："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtCASO" Text="0" CssClass="mctxt2"
                                                 ReadOnly="true"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="匹配金额 ："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtApplyAmount" CssClass="mctxt" 
                                                 onblur="txtIsNumberOnly(this.id);Applied();" Text="0"></asp:TextBox>
                                                <%--<input type="text" class="mctxt" id="txtApplyAmount" runat="server"
                                                 onblur="txtIsNumberOnly(this.id);Applied();" value="" />--%>
                                                <span class="red">*</span>
                                            </li>
                                            <li class="li2" style="display:none;">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="匹配日期："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtApplyDate" Text="" CssClass="mctxt"></asp:TextBox>
                                                <span class="red">*</span>
                                            </li> 
                                            <li class="li2" style="display:none;">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="匹配人："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtApplyPerson" Text="" ReadOnly="true" CssClass="mctxt"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="客户编号："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtCustomerCode" Text="" ReadOnly="true" CssClass="mctxt2"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="客户："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtCustomer" Text="" ReadOnly="true" CssClass="mctxt2"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label ID="Label3" CssClass="mclbldiv" runat="server" Text="CE："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtCEName" Text="" ReadOnly="true" CssClass="mctxt2"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="收款类型："></asp:Label>
                                                <dx:ASPxComboBox ID="cbCollectionType" runat="server" DropDownStyle="DropDown" 
                                                     Width="215px">
                                                    <Items>
                                                        <dx:ListEditItem Text="预付款" Selected="true" Value="1" />
                                                        <dx:ListEditItem Text="发货款" Value="2" />
                                                        <dx:ListEditItem Text="到货款" Value="3" />
                                                        <dx:ListEditItem Text="验收款" Value="4" />
                                                        <dx:ListEditItem Text="质保款" Value="5" />
                                                    </Items>
                                                </dx:ASPxComboBox>
                                            </li>
                                            <li class="li2" style="display:none;">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="发票号："></asp:Label>
                                                <asp:TextBox runat="server" ID="TextBox1" Text="" CssClass="mctxt"></asp:TextBox>
                                                <span class="red">*</span>
                                            </li>
                                            <li class="li2" style="display:none;">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="Entity："></asp:Label>
                                                <asp:TextBox runat="server" ID="TextBox2" Text="" CssClass="mctxt"></asp:TextBox>
                                            </li>
                                            <li class="li2" style="display:none;">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="Collection Date："></asp:Label>
                                                <asp:TextBox runat="server" ID="TextBox3" Text="" CssClass="mctxt"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text="Unallocated Balance："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtUnallocatedBalance" Text="0" ReadOnly="true" CssClass="mctxt2"></asp:TextBox>
                                            </li>
                                        </ul>
                                        <ul>
                                            <li class="li2">
                                                <asp:Label CssClass="mclbldiv" runat="server" Text=""></asp:Label>
                                                <asp:Button ID="btnadd" runat="server" Text="添 加" CssClass="cmdStyle"
                                                   OnClientClick="return ValueCheck();" OnClick="btnadd_Click"/><%--SetConvertDiv('block')--%>
                                                <asp:Button ID="btnedit" runat="server" Text="保 存" CssClass="cmdStyle"
                                                   OnClientClick="return ValueCheck();"  OnClick="btnedit_Click" Visible="False"/>
                                            </li> 
                                            <script language="javascript" type="text/javascript">
                                                function ValueCheck() {
                                                    if (document.getElementById("tc_txtBankReference").value == "") {
                                                        alert("银行参考号不能为空！");
                                                        return false;
                                                    }
                                                    if (document.getElementById("tc_cbContractNo").value == "") {
                                                        alert("合同号不能为空！");
                                                        return false;
                                                    }
                                                    if (document.getElementById("tc_cbSalesOrder").value == "") {
                                                        alert("订单号不能为空！");
                                                        return false;
                                                    }
                                                    else if (document.getElementById("tc_txtApplyAmount").value == "0") {
                                                        alert("匹配金额不能为 0");
                                                        return false;
                                                    }
                                                    return true;
                                                }
                                            </script>
                                        </ul>
                                    </div>
                                    <div style="float:left; margin:20px 80px 0 0; width:400px; table-layout:fixed;">
                                        <ul>
                                            <li class="li2">
                                                <asp:Label ID="Label2" CssClass="mclbldiv2" runat="server" Text="银行参考号："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtBankReference" Text="" ReadOnly="true" CssClass="mctxt2"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label ID="Label4" CssClass="mclbldiv2" runat="server" Text="汇票人/开票人名称："></asp:Label>
                                                <asp:TextBox ID="txtOrderingPartyName" runat="server" ReadOnly="true" Text="#" CssClass="mctxt2"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label ID="Label11" CssClass="mclbldiv2" runat="server" Text="客户编号："></asp:Label>
                                                <asp:TextBox ID="txtCustomerCode2" runat="server" ReadOnly="true" Text="#" CssClass="mctxt2"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label ID="Label12" CssClass="mclbldiv2" runat="server" Text="客户名称："></asp:Label>
                                                <asp:TextBox ID="txtCustomerName" runat="server" ReadOnly="true" Text="#" CssClass="mctxt2"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label ID="Label5" CssClass="mclbldiv2" runat="server" Text="交易金额(总)："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtTransactionAmount" Text="0" ReadOnly="true" CssClass="mctxt2"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label ID="Label6" CssClass="mclbldiv2" runat="server" Text="已分配金额："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtTransactionAmountAssigned" Text="0" ReadOnly="true" CssClass="mctxt2"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label ID="Label7" CssClass="mclbldiv2" runat="server" Text="剩余可分配金额："></asp:Label>
                                                <input type="text" runat="server" id="txtTransactionAmountLeft" class="mctxt2" readonly="readonly" value="0" />
                                            </li>
                                            <li class="li2">
                                                <asp:Label ID="Label8" CssClass="mclbldiv2" runat="server" Text="收款方式："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtType" Text="" ReadOnly="true" CssClass="mctxt2"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label ID="Label9" CssClass="mclbldiv2" runat="server" Text="Credit Check："></asp:Label>
                                                <asp:CheckBox ID="chbCreditCheck" Enabled="false" runat="server" />
                                            </li>
                                            <li class="li2" style="display:none">
                                                <asp:Label ID="Label10" CssClass="mclbldiv2" runat="server" Text="iScala booked check："></asp:Label>
                                                <asp:CheckBox ID="chbiScalabookedcheck" Enabled="false" runat="server" />
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </dx:ContentControl>
                        </ContentCollection>
                    </dx:TabPage>
                </TabPages>                
                <Paddings Padding="2px" PaddingLeft="5px" PaddingRight="5px"></Paddings>
                <ContentStyle>
                    <Border BorderColor="#AECAF0" BorderStyle="Solid" BorderWidth="1px" />
                    <Border BorderColor="#AECAF0" BorderStyle="Solid" BorderWidth="1px"></Border>
                </ContentStyle>
            </dx:ASPxPageControl>
            <asp:HiddenField ID="hidid" runat="server" Value="0" />
            <asp:HiddenField ID="hidAccountStatementItemCode" runat="server" Value="0" />   
            <asp:HiddenField ID="hidIsEnabledCreditCheck" runat="server" Value="0" />           
          </ContentTemplate>
          <Triggers>
                <asp:PostBackTrigger ControlID="tc$btnadd" />
                <asp:PostBackTrigger ControlID="tc$btnedit" />
                <asp:PostBackTrigger ControlID="tc$btnMathedExport" />
                <asp:PostBackTrigger ControlID="tc$btnMathingExport" />
          </Triggers>
        </asp:UpdatePanel>
    </form>
</body>
</html>
